// 调停课请求
import axios from "axios";

export function suspendClass(sessionId, type, originWeek, originDay, originClass, originClassroomId, originBuildingId, description) {
    return axios({
        url: '/api/audition/adjustment',
        method: 'POST',
        headers: {
            Authorization: localStorage.getItem("Authorization")
        },
        data: {sessionId, type, originWeek, originDay, originClass, originClassroomId, originBuildingId, description}
    }).then(response => {
        return {
            result: true,
            data: response.data
        }
    }).catch(error => {
        return {
            result: false,
            msg: error.response.data.msg
        }
    })
}

export function adjustmentClass(sessionId, type, originWeek, originDay, originClass, originClassroomId, originBuildingId, newWeek, newDay, newClass, newClassroomId, newBuildingId, description) {
    return axios({
        url: '/api/audition/adjustment',
        method: 'POST',
        headers: {
            Authorization: localStorage.getItem("Authorization")
        },
        data: {
            sessionId,
            type,
            originWeek,
            originDay,
            originClass,
            originClassroomId,
            originBuildingId,
            newWeek,
            newDay,
            newClass,
            newClassroomId,
            newBuildingId,
            description
        }
    }).then(response => {
        return {
            result: true,
            data: response.data
        }
    }).catch(error => {
        return {
            result: false,
            msg: error.response.data.msg
        }
    })
}